package com.mt.controller;


import com.mt.constants.Result;
import com.mt.exception.GlobalException;
import com.mt.service.AclService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

/**
 * @author Wang
 * @Description ACL权限服务
 * @since 2020-11-12
 */

@RestController
@RequestMapping("/mt/acl")
@Slf4j
public class AclController {
    @Resource
    AclService aclService;

    @PostMapping("/add")
    public Result addAcl(){
        Result<Object> result = new Result<>();
        boolean save = aclService.save(null);
        if (save){
            throw new GlobalException("操作失败");
        }
        result.setData(save);
        return result;

    }

}
